package com.sc.es.search;

import com.sc.es.common.HouseResult;
import com.sc.es.common.RentSearchForm;
import com.sc.es.common.ServiceResult;
import com.sc.es.dto.HouseBucketDTO;
import com.sc.es.form.MapSearch;

import java.util.List;

/**
 * @author sc
 * Created on  2018/2/9
 */
public interface ISearchService {
    /**
     * 索引目标房源
     * @param houseId
     */
    void index(Integer houseId);

    /**
     * 移除房源索引
     * @param houseId
     */
    void remove(Integer houseId);

    ServiceResult query(RentSearchForm searchForm);

    /**
     * 搜索自动补全
     * @param prefix
     * @return
     */
    HouseResult autoComplete(String prefix);

    /**
     * 聚合同小区
     * @param cityEnName
     * @param regionEnName
     * @param district
     * @return
     */
    HouseResult aggregateDistrictHouse(String cityEnName, String regionEnName, String district);

    /**
     * 聚合同城市
     * @param cityEnName
     * @return
     */
    ServiceResult<HouseBucketDTO> aggCityHouse(String cityEnName);

    /**
     * 城市级别查询
     * @return
     */
    ServiceResult mapQuery(String cityEnName,String orderBy,String orderDirection,int start,int size);

    /**
     * 地图范围查找
     * @return
     */
    ServiceResult mapQuery(MapSearch mapSearch);
}
